A Language for Bi-Directional Tree Transformations (Working Draft of Full Version)
نویسندگان
چکیده
We develop a semantic foundation and a core programming language for bi-directional transformations on tree-stuctured data. In one direction, these transformations, called lenses, map a complex “concrete” tree into a simplified “abstract” one; in the other, they map a modified abstract tree, together with the original concrete tree, to a correspondingly modified concrete tree. The challenge of understanding and designing these transformations arises from their asymmetric nature: information is discarded when mapping from concrete to abstract, and must be restored on the way back. We identify a natural mathematical space of “well-behaved lenses” whose two components are constrained to fit together in a sensible way. We study definedness and continuity in this setting, show that well-behaved lenses form a complete partial order, and state a precise connection with the classical theory of “update translation under a constant complement” from databases. We then instantiate our semantic framework as a small programming language, called Hocus Focus, whose expressions denote well-behaved lenses operating on tree-structured data. The primitives include familiar constructs from functional programming (composition, mapping, projection, recursion) together with some novel primitives for manipulating trees (splitting, pruning, pivoting, etc.). An extended example shows how Hocus Focus can be used to define a lens that translates between a native HTML representation of browser bookmarks and a generic form of abstract bookmark structures.
منابع مشابه
A Language for Bi-Directional Tree Transformations
We present a semantic foundation and a collection of program combinators for bi-directional transformations on tree-structured data. In one direction, these transformations map a “concrete” tree into a simplified “abstract” one; in the other, they map a modified abstract tree, together with the original concrete tree, to a correspondingly modified concrete tree. The challenge of understanding a...
متن کاملMATHEMATICAL ENGINEERING TECHNICAL REPORTS A Compositional Approach to Bidirectional Model Transformation
Model-driven architecture is a discipline in software engineering that aims to develop, maintain and evolve software by performing model transformations. Many attempts have been made on introducing bidirectionality to model transformation to enable better consistency and traceability between different models. However, the existing approaches are ad-hoc without clear updating semantics, hardly s...
متن کاملAttitudes towards English Language Norms in the Expanding Circle: Development and Validation of a new Model and Questionnaire
This paper describes the development and validation of a new model and questionnaire to measure Iranian English as a foreign language learners’ attitudes towards the use of native versus non-native English language norms. Based on a comprehensive review of the related literature and interviews with domain experts, five factors were identified. A draft version of a questionnaire based on those f...
متن کاملTwo optimal algorithms for finding bi-directional shortest path design problem in a block layout
In this paper, Shortest Path Design Problem (SPDP) in which the path is incident to all cells is considered. The bi-directional path is one of the known types of configuration of networks for Automated Guided Vehi-cles (AGV).To solve this problem, two algorithms are developed. For each algorithm an Integer Linear Pro-gramming (ILP) is determined. The objective functions of both algorithms are t...
متن کاملvi . iv , a bi - directional version of the vi full - screen
SUMMARY This paper describes the semantics, design, and implementation of vi.iv, a bi-directional revision of vi, the standard, full-screen editor available on UNIX™ systems. The main goal was to produce the new program with as little change as possible to the semantics and implementation of the original vi.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2003